<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use mdm\admin\components\Helper;
/* @var $this yii\web\View */
/* @var $model backend\models\Goods */
/* @var $form yii\widgets\ActiveForm */

?>
<style>
    #form .form-group{width:40%;float:left;margin-right:10%;margin-bottom:0px;}

    #form .field-goods-priceunit,#form .field-goods-remark,#form .field-goods-gys,#form .buttons{width:100%;}
    #form .field-goods-priceunit .form-control,#form .field-goods-gys .form-control{width:40%;}
</style>

<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h4 class="modal-title" id="myModalLabel"><?= Html::encode($this->title) ?></h4>
</div>
<?php $form = ActiveForm::begin(['class'=>'form-inline','id'=>'form']); ?>
<div class="modal-body" >
    <div class="goods-form">



        <?= $form->field($model, 'class')->dropDownList($classes,['options' => [$classcheck => ['selected' => 'selected']],['prompt'=>$classcheck]]) ?>


        <?= $form->field($model,'nextid')->dropDownList($yylist,['options' => [$myyy => ['selected' => 'selected']],['prompt'=>$myyy]]) ?>

        <?= $form->field($model, 'goodsno')->textInput(['maxlength' => true]) ?>

        <?= $form->field($model, 'goodsid')->textInput(['maxlength' => true,'placeholder'=>'新蛋编码']) ?>

        <?= $form->field($model, 'goodsname')->textInput(['maxlength' => true]) ?>

        <?= $form->field($model, 'inprice')->textInput() ?>

        <?= $form->field($model, 'priceunit')->dropDownList(['人民币','美元'],['options' => [$unitcheck => ['selected' => 'selected']],['prompt'=>$unitcheck]]) ?>




        <?php
        if(Helper::checkRoute('/*')) {?>
            <?php echo $form->field($model, 'createtime')->textInput() ?>

            <?php echo $form->field($model, 'updatetime')->textInput() ?>

            <?php echo $form->field($model, 'lastprice')->textInput() ?>

            <?php echo $form->field($model, 'upfee')->textInput() ?>

            <?php $checkstatus = Html::tag('label', "审核状态", ['class' => 'control-label']);
            $checkstatus.=chr(10).chr(13);
//        if(Helper::checkRoute('check')) {
            $checkstatus .= Html::dropDownList('Goods[check]', $model->check, [0 => '待审核', 1 => '一审通过', 2 => '二审通过', 3 => '审核通过', 4 => '审核不通过'], ['class' => 'form-control']);
//        }else{
//            $checkstatus .= Html::dropDownList('Goods[check]', $model->check, [0 => '待审核', 1 => '一审通过', 2 => '二审通过', 3 => '审核通过', 4 => '审核不通过'], ['class' => 'form-control', 'disabled' => true]);
//        }

            $checkstatus .= Html::tag("div",'',['class'=>'help-block']);
            ?>
            <?php echo Html::tag('div', $checkstatus, ['class'=>'form-group field-goodssearch-check']);?>

            <?php    echo $form->field($model, 'gys')->dropDownList($allStatus, ['options' => [$needSelected => ['selected' => 'selected']], ['prompt' => $needSelected]]);
            echo Html::tag('label', $model->export ? '导出过':'未导出过', ['class' => 'control-label']);
        }

        ?>

        <?= $form->field($model, 'remark')->textarea(['rows' => 6]) ?>





    </div>
    <div style="clear:both"></div>
</div>
<div class="modal-footer">
    <?= Html::submitButton('保存', ['class' => 'btn btn-success']) ?>
    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
    <!--                <button type="button" class="btn btn-primary">提交更改</button>-->
</div>
<?php ActiveForm::end(); ?>

<script>
    // $("#close").click(function(){
    //     $('#checkgoods').modal('hide');
    //     $("#checkgoods").on("hidden.bs.modal", function() {
    //         $(this).removeData("bs.modal");
    //     });
    //
    // });
    $(function(){
        $("#checkgoods").on("hidden.bs.modal", function() {
                    $(this).removeData("bs.modal");
                });
    });
</script>